package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.PrInvoiceDTO;
import com.financing.wap.dao.IPrInvoiceDao;
import com.financing.wap.common.SqlName;
/**
 * pr_invoice  
 * 项目发票 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("prInvoiceDao")
public class PrInvoiceDaoImpl extends BaseDaoImpl<PrInvoiceDTO, Integer> implements IPrInvoiceDao {


	@Override
	public int insert(PrInvoiceDTO prInvoice) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.PrInvoiceSql.insert, prInvoice);
	}

	@Override
	public void update(PrInvoiceDTO prInvoice) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.PrInvoiceSql.update, prInvoice);
	}

	@Override
	public void updateForce(PrInvoiceDTO prInvoice) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.PrInvoiceSql.updateForce, prInvoice);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.PrInvoiceSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<PrInvoiceDTO> queryList(PrInvoiceDTO prInvoice) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.PrInvoiceSql.queryList, prInvoice);
	}

	@Override
	public int queryListCount(PrInvoiceDTO prInvoice) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.PrInvoiceSql.queryListCount, prInvoice);
	}

	@Override
	public PrInvoiceDTO loadById(Integer id) throws SQLException {
		return  (PrInvoiceDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.PrInvoiceSql.loadById,id);
	}

	@Override
	public Class<PrInvoiceDTO> getEntityClass() {
		return PrInvoiceDTO.class;
	}
 	
}
